﻿@model RonYee.Models.InStore

@{
    ViewBag.Title = "图书入库";
    Layout = "~/Views/Shared/_LayoutOfSecondPage.cshtml";
}

<script type="text/javascript">
    $("#checkInfo").bind("click", function () {
        $.ajax({
            url: "../../InStore/ConfirmInfo",
            type: "GET",
            data: { "isbn": $("input#ISBN").val() },
            dataType: "json",
            success: function (data) {
                $("#labelISBN").empty();
                $("#labelBookName").empty();
                $("#labelStorageArea1").empty();
                $("#labelStorageArea2").empty();
                $("#labelholdUser").empty();
                $.each(data.Data.list, function (i, item) {
                    $("#labelISBN").append("<input value='" + item.ISBN + "id='ISBN'" + " />");
                    $("#labelBookName").append("<input value='" + item.BookName + "id='BookName'" + " />");
                    $("#labelStorageArea1").append("<input value='" + item.StorageArea1 + "id='StorageArea1'" + " />");
                    $("#labelStorageArea2").append("<input value='" + item.StorageArea2 + "id='StorageArea2'" + " />");
                    $("#labelholdUser").append("<input value='" + item.HoldUser + "id='holdUser'" + " />");
                });
            }
        });
    });
</script>


<div class="box_padding">
    <h3><i class="ui-icons"></i>检索图书</h3>
    <div class="box_top ui-icons"></div>
    <div class="box_bg">
      <div class="box_padding">
       <div class="border_line">
          @using (Html.BeginForm("Create", "InStore", FormMethod.Post))
            {
                <table width="100%" border="0" cellpadding="0" cellspacing="0">
                <tbody>
                <tr>
                    <td  class="tdName">ISBN</td>
                    <td  class="tdData">
                        <input type="text" id="s_isbn" name="s_isbn"/>
                    </td>
                    <td class="tdData"></td>
                    <td class="tdData">
                        <input type="submit" value="查阅是否已存在" class="Button1 ui-icons" />
                    </td>
                </tr>  
                </tbody>
                </table>    
            }
        
       </div>
      </div>
    </div>
    <div class="box_down ui-icons"></div>
    <h3><i class="ui-icons"></i> 图书入库</h3>
    <div class="box_top ui-icons"></div>
    <div class="box_bg">
      <div class="box_padding">
       <div class="border_line">
          @using (Html.BeginForm("AddBooksToStore", "InStore", FormMethod.Post))
                {
                    @Html.ValidationSummary(true)

                    <table width="100%" border="0" id="MyTable" cellpadding="0" cellspacing="0">
                    <tbody>
                    <tr>
                        <td  class="tdName">ISBN</td>
                        <td  class="tdData">
                           @Html.TextBoxFor(model=>model.ISBN)
                        </td>
                        <td class="tdName">书名</td>
                        <td class="tdData">
                          @Html.TextBoxFor(model=>model.BookName)
                        </td>
                    </tr>
                    <tr>
                        <td class="tdName">库存位置1</td>
                        <td class="tdData">
                           @Html.TextBoxFor(model=>model.StorageArea1)
                        </td>
                        <td class="tdName">图书持有者</td>
                        <td class="tdData">
                           @Html.TextBoxFor(model=>model.HoldUser)
                        </td>
                    </tr>
                    <tr>
                        <td class="tdData"></td>
                        <td class="tdData">
                        </td>
                        <td class="tdData"></td>
                        <td class="tdData">
                          <input type="submit" value="Create" class="Button1 ui-icons" />
                        </td>
                    </tr>  
                    </tbody>
                    </table>
                    
                }
        
       </div>
      </div>
    </div>
    <div class="box_down ui-icons"></div>
</div>
<div class="line_top"></div>


